﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;

namespace FerrSimplicity
{
    interface IColorTweenable
    {
        Color Tint { get; set; }
    }
    enum  TweenUpdates
    {
        X   = 1,
        Y   = 2,
        Z   = 4,
        XYZ = 1 | 2 | 4,
        XY  = 1 | 2,
        XZ  = 1 | 4,
        RotateX   = 8,
        RotateY   = 16,
        RotateZ   = 32,
        RotateXYZ = 8 | 16 | 32,
        R    = 64,
        G    = 128,
        B    = 256,
        A    = 512,
        RGBA = 64 | 128 | 256 | 512,
        RGB  = 64 | 128 | 256,
        ScaleX   = 1024,
        ScaleY   = 2048,
        ScaleZ   = 4096,
        ScaleXYZ = 1024 | 2048 | 4096
    }
    class Tween
    {
        BaseGameObject mTweenObject;
        Transform3D[]  mTweenStates;
        float      []  mTweenTimes;
        Color          mStartColor;
        Color          mDestColor;
        TweenUpdates   mUpdateItems;

        float mCurrTime;
        float mMaxTime;

        int mTweenFrame;

        public void Update(float aTime)
        {
            mCurrTime    += aTime;
            float percent = mCurrTime / mMaxTime;

            throw new NotImplementedException();
            // travel backwards till we're at the current frame (in case of rewinds)
            /*while (mCurrTime < mTweenTimes[mTweenFrame])
                mTweenFrame--;

            while (mCurrTime > mTweenFrame[mTweenFrame])
                mTweenFrame++;

            float framePercent = aTime - mTweenFrame[mTweenFrame] 
            mTweenFrame*/
        }
    }
    public class SystemTweens
    {
        #region Singleton
        private static SystemTweens mInstance = null;
        public  static SystemTweens Instance
        {
            get { if (mInstance != null) mInstance = new SystemTweens(); return mInstance; }
        }
        private SystemTweens()
        {
            throw new NotImplementedException();
        }
        #endregion

        #region Fields
        #endregion
    }
}
